define(function(require, factory) {
	'use strict';
	var bookVM = avalon.define({
		$id: "book",
		book: {}
	});
	return (
		 avalon.controller(function($ctrl) {
			 $ctrl.$onRendered = function() {
				 console.log("book on rendered");
			 };
			 var query = new Parse.Query(Book);
			 $ctrl.$onEnter = function(params) {
				 bookVM.book = {};
				 query.get(params.id, {
					 success: function(data) {
						 bookVM.book = data.toJSON();
					 }
				 })
			 }
		 })
	 )
});